package com.intelligent.controller.feign;

import com.intelligent.entity.User;
import com.intelligent.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign/user")
public class UserFeignController {

    @Autowired
    private UserService userService;

    /**
     * 提供给其他服务的精简查询：仅按ID返回基础用户信息
     */
    @GetMapping("/byId")
    public User getById(@RequestParam("id") Long id) {
        return userService.getById(id);
    }
}
